﻿using System;

class Program
{
    static void Main()
    {
        // 输出表头
        //Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}", "Type", "Size (bytes)", "Min Value", "Max Value");
       // Console.WriteLine(new string('-', 80));

        // 输出每种类型的信息
        PrintTypeInfo<sbyte>("sbyte");
        PrintTypeInfo<byte>("byte");
        PrintTypeInfo<short>("short");
        PrintTypeInfo<ushort>("ushort");
        PrintTypeInfo<int>("int");
        PrintTypeInfo<uint>("uint");
        PrintTypeInfo<long>("long");
        PrintTypeInfo<ulong>("ulong");
        PrintTypeInfo<float>("float");
        PrintTypeInfo<double>("double");
        PrintTypeInfo<decimal>("decimal");
    }

    static void PrintTypeInfo<T>(string typeName) where T : struct
    {
        Type type = typeof(T);
        int size = System.Runtime.InteropServices.Marshal.SizeOf(type);
        dynamic minValue = type.GetField("MinValue").GetValue(null);
        dynamic maxValue = type.GetField("MaxValue").GetValue(null);

        Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}", typeName, size, minValue, maxValue);
    }
}